package com.bazinga.contact.view;


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class ApplyPageAction extends ActionSupport implements SessionAware {
	private static final long serialVersionUID = 1L;
	private Map<String, Object> session;
	private String email;
	private final String dbServer = "127.0.0.1";
	private Long jobid;
	private String title;
	
	public Long getJobid() {
		return jobid;
	}
	public void setJobid(Long jobid) {
		this.jobid = jobid;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	

	public void setSession(Map<String, Object> session) {
		this.session = session;
	}
	/**
     * @see HttpServlet#HttpServlet()
     */
	
	public String execute() {
		this.session = ActionContext.getContext().getSession();
		if(!session.containsKey("logged-in")) {
			return "login";
		}	
		title = "Job Application for JobID: "+jobid+" - Title: "+title;
		return "success";
	}
    public ApplyPageAction() {
        super();
        // TODO Auto-generated constructor stub
    }

}
